package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("aaa.jpg");
        FileOutputStream fos = new FileOutputStream("aaa_cop.jpg");
        long start = System.currentTimeMillis();//自1970年1月1日0时开始
        int a ;
        while ((a=fis.read())!=-1){
            fos.write(a);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制完成,花费时间"+(end-start));
        fis.close();
        fos.close();
    }
}
